<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="keywords" content="夕阳渐落去阅读页,第三十四章  少女情窦开"/>
        <link rel="stylesheet" type="text/css" href="/static/layui/css/layui.css" th:href="@{/static/layui/css/layui.css}"/>
        <link rel="stylesheet" type="text/css" href="/static/css/part1.css" th:href="@{/static/css/part1.css}" />
        <link rel="stylesheet" type="text/css" href="/static/css/read.css" th:href="@{/static/css/read.css}" />
    </head>
    <body class="rb_1">
        <div class="head-fixed-reader head-simple">
            <div class="wrap">
                <div class="part1" th:replace="~{index/index::part1}"></div>
            </div>
        </div>
        <!-- 大包 -->
        <div class="readerPageWrap">
            <div class="h20-blank"></div>
            <!-- 推广层 -->
            <div class="goodgame">
                <a href="" target="_blank"></a>
            </div>
            <!-- 主内容 -->
            <div class="rw_3" id="reader_warp">
                <!-- 1.	阅读器头部推荐位 -->
                <div class="com-recbox"></div>
                <!-- 阅读页start -->
                <!-- 包裹层 -->
                <div  class="rft_1">
                    <!-- 内容主盒 -->
                    <div class="reader_box"  >
                        <div class="marker " ></div>
                        <div class="title">
                            <div class="iconbox">
                                <em class=""></em>
                            </div>
                            <div th:text="${chapter.chapterTitle}" class="title_txtbox"></div>
                        </div>
                        <div class="bookinfo">
                         更新时间：<span  th:text="${#dates.format(chapter.createDate, 'yyyy-MM-dd HH:mm')}"></span>
                            <a th:href="|@{/chapter/list/}${fictionId}|" class="reader_lnkbtn" >章节目录</a>
                        </div>

                        <div style="height: 5px" class="reader_line"></div>
                        <div class="content" itemprop="acticleBody">
                            <p  th:utext="${content}"></p>
                        </div>
                        <!-- 订阅盒 -->

                        <!-- 作者的话 -->

                        <!-- 捧场按钮 -->

                        <!-- 操作区 -->
                        <div class="chap_btnbox">
                            <a id="prev" th:href="|/${midPath}/read/${fictionId}/|+(${sort}-1)"
                               th:unless="${sort}==1">
                                <button type="button" class="layui-btn">上一章</button>
                            </a>

                            <a id="menu" th:href="|@{/chapter/list/}${fictionId}|">
                                <button type="button" class="layui-btn">目录</button>
                            </a>

                            <a id="next" th:href="|/${midPath}@{/read/}${fictionId}/|+(${sort}+1)"
                               th:unless="${sort}==${maxSort}" class="nextchapter">
                                <button type="button" class="layui-btn">下一章</button>
                            </a>
                        </div>
                        <input id="fiction_id" type="hidden" th:value="${chapter.fictionId}"/>
                        <input id="sort" type="hidden" th:value="${chapter.sort}"/>
                        <div class="ctrl_tips">
                            按“键盘左键←”返回上一章&nbsp;&nbsp;&nbsp;按“键盘右键→”进入下一章&nbsp;&nbsp;&nbsp;按“空格键”向下滚动
                        </div>
                    </div>
                    <!-- /内容主盒 -->
                </div>
                <!-- /包裹层 -->
            </div>
            <!-- 控制手柄 -->
            <div class="h20-blank"></div>
            <!-- /大包 -->
        </div>
        <script src="/static/js/jquery-3.7.0.js" th:src="@{/static/js/jquery-3.7.0.js}"></script>
        <script>
            let next = $('#next').attr('href');
            let prev = $('#prev').attr('href');
            let menu = $('#menu').attr('href');
            $(document).keydown(function(event) {
                switch (event.which) {
                    case 37:
                        console.log(event.keyCode);
                        window.location.href = prev!=null?prev:menu;
                        break;
                    case 39:
                        window.location.href = next==null?menu:next;
                        console.log(event.which);
                        break;
                    default:
                        console.log(event.which);
                }

            });
        </script>
    </body>
</html>
